package fourzerofour.liangjunwei.day01;

import java.util.Scanner;

public class Question7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int n = scanner.nextInt();
        System.out.println("请再输入一个数：");
        int n1 = scanner.nextInt();
        System.out.println("请再输入一个数：");
        int n2 = scanner.nextInt();
        boolean bl = true;
        String str = "";
        for (int j = 1; j <= n; j++) {
            if (j % n1 == 0 && j % n2 == 0) {
                str += " " + j;
                bl = false;
            }
        }
        if (bl) {
            System.out.println(n + "以内未找到能被" + n1 + "和" + n2 + "同时整除的偶数");
        } else {
            System.out.println(n + "以内能被" + n1 + "和" + n2 + "同时整除的偶数为：" + str);
        }
    }
}
